import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int m = sc.nextInt();
        int x = sc.nextInt();
        int[] arr = new int[n];
        boolean[][] flag = new boolean[n][n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }

        for (int i = 1; i < n; i++) {
            for (int j = 0; j < i; j++) {
                flag[i][j] = ((arr[i] ^ arr[j]) == x);
            }
        }

        while (m > 0) {
            m--;
            int l = sc.nextInt();
            int r = sc.nextInt();
            boolean isExist = false;
            for (int i = l - 1; i <= r - 1; i++) {
                for (int j = l - 1; j < i; j++) {
                    if (flag[i][j]) {
                        isExist = true;
                        break;
                    }
                }
                if (isExist) {
                    break;
                }
            }
            if (isExist) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }


        sc.close();
    }
}
